﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yule8xCommon.Applib;
using Yule8xCommon.Typelib;
using Yule8xModel;
using Yule8xWechat.Applib;

namespace Yule8xWechat.Agent
{
    public partial class QrInfo : System.Web.UI.Page
    {
        protected WxUserInfoResult wxUser;
        protected void Page_Load(object sender, EventArgs e)
        {
            int user_id = RequestUtil.GetInteger("user_id");
            if (user_id > 0)
            {
                wxUser = UserModels.GetWxUserInfo(user_id);
                if (null == wxUser)
                {
                    ResponseUtil.WriteEnd("user_id无效!");
                }
            }
            else
            {
                wxUser = LoginPageBase.GetLoginInfo();
                if (null == wxUser)
                {
                    Response.Redirect(WechatUrls.GetUserInfoUrl("agent", 0), true);
                }
            }
            /*
            object loginData = Session["login"];
            if (null != loginData)
            {
                wxUser = loginData as WxUserInfoResult;
            }
            if (null == loginData || null == wxUser)
            {
                LogUtil.Instance.WriteInfo("[代理首页] 未登录");
                Response.Redirect(WechatUrls.GetUserInfoUrl("agent"), true);
            }*/
        }
    }
}